package com.helloUIBinder.client.events;

import com.google.gwt.event.shared.GwtEvent;
import com.helloUIBinder.model.BlogPost;

public class OnAdminBlogPostTableClickEvent extends GwtEvent<OnAdminBlogPostTableClickHandler> {

    public static GwtEvent.Type<OnAdminBlogPostTableClickHandler> TYPE = new GwtEvent.Type<OnAdminBlogPostTableClickHandler>();

    public final static String EDIT = "EDIT";
    public final static String DELETE = "DELETE";
    public final static String CREATE = "CREATE";

    private BlogPost clickedBlogPost;
    private String currentAction;

    @Override
    public GwtEvent.Type<OnAdminBlogPostTableClickHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(OnAdminBlogPostTableClickHandler handler) {
        handler.click(this);
    }

    public BlogPost getClickedBlogPost() {
        return clickedBlogPost;
    }

    public void setClickedBlogPost(BlogPost clickedBlogPost) {
        this.clickedBlogPost = clickedBlogPost;
    }

    public String getCurrentAction() {
        return currentAction;
    }

    public void setCurrentAction(String currentAction) {
        this.currentAction = currentAction;
    }
}
